package com.woniu.deal.order.feignclient;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniu.common.dto.*;
import com.woniu.common.entity.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

@FeignClient(value = "deal-order"/*, fallback = 降级方法实现类*/)
public interface DealOrderFeign {
    //分页+条件查询订单详情
    @PostMapping("/order/{pageIndex}/{pageSize}")
    public Result getAllByConditionPage(
            @PathVariable("pageIndex") int pageIndex,
            @PathVariable("pageSize") int pageSize,
            @RequestBody DealOrderDTO dealOrderDTO
    );


    //根据订单id查询订单
    @GetMapping("/{id}")
    public Result<DealOrder> getDealOrderById(@PathVariable("id") int id);


    //调用支付接口
    @GetMapping("/alipay/{dealOrderNum}")
    public String pay(@PathVariable("dealOrderNum") String dealOrderNum/*, HttpServletResponse response*/);
}
